<template>
  <div class="left-menus" :class="collapsed? 'collapsed' : ''">
    <div class="menu-item">
      <el-icon><House /></el-icon>
      <span>My Menus</span>
    </div>
    <div class="menu-item">
      <el-icon><House /></el-icon>
      <span>My Menus</span>
    </div>
    <div class="menu-item">
      <el-icon><House /></el-icon>
      <span>My Menus</span>
    </div>
    <div class="menu-item">
      <el-icon><House /></el-icon>
      <span>My Menus</span>
    </div>
  </div>
</template>
<script setup>
import { House } from '@element-plus/icons-vue'
defineProps(['collapsed'])
</script>

<style lang="scss" scoped>
.left-menus {
  margin-top: 20px;
  width: 240px;
  .menu-item {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin: 5px 20px;
    cursor: pointer;
    height: 50px;
    line-height: 50px;
    transition: all 0.3s ease;
    border-radius: 10px;
    .el-icon {
      width: 40px;
    }
    span {
      width: 200px;
    }
    &.on {
      color: #fff;
      background-color: #409EFF;
    }
  }
  &.collapsed {
    width: 100%;
    .menu-item {
      margin: 0;
      border-radius: 0;
      padding: 0;
      justify-content: center;
      span {
        display: none;
      }
    }
  }
}
</style>